package com.ngkj.zmfptwebsocket.util;

import org.springframework.web.socket.WebSocketSession;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class WsSessionManager {

    private static Map<String, WebSocketSession> map = new ConcurrentHashMap<>();

    public static void add(String id, WebSocketSession session){
        map.put(id ,session);
    }

    public static void del(String id){
        map.remove(id);
    }

    public static WebSocketSession get(String id){
        return map.get(id);
    }

}
